<!DOCTYPE html>
<html lang="en">
<head>
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>

    <style>

        a{
            text-decoration: none;
        }
        button{
            width: 80px;
            height: 40px;
        }
        .zt{

            font-weight: bolder;
            color: #FF0000;
        }
        .foo{
            padding:0px 100px;
        }
        #qq{
            padding-left: 350px;
        }

    </style>
</head>
<body>


<div id="app">

    <el-form   :model="details"  ref="details"  >

        <input v-model="details.id" type="hidden" name="id">

        <div class="foo">
            <el-form-item label="学术地位"  prop="standing" class="zt">
                <el-input type="textarea"  v-model="details.standing" name="standing" ></el-input>
            </el-form-item>

            <el-form-item label="技术优势"  prop="goodness" class="zt">
                <el-input type="textarea"  v-model="details.goodness" name="goodness" ></el-input>
            </el-form-item>

            <el-form-item label="科室简介"  prop="introduction" class="zt">
                <el-input type="textarea"  v-model="details.introduction" name="introduction" ></el-input>
            </el-form-item>

            <el-form-item label="成果创新"  prop="gain" class="zt">
                <el-input type="textarea"  v-model="details.gain" name="gain" ></el-input>
            </el-form-item>

            <el-form-item label="就诊须知"  prop="notice" class="zt">
                <el-input type="textarea"  v-model="details.notice" name="notice" ></el-input>
            </el-form-item>

            <div id="qq">
                <el-button><a  href="/ssm/departmentcontrol/departmentmain.html">返回</a></el-button>
                <el-button type="primary" @click="updateDetails()">修改</el-button>
            </div>

        </div>
    </el-form>

</div>



<script>

    var id = window.location.href.split("=")[1];

    $.get("/ssm/department/listDetails?id="+id ,function (backData) {
        if (backData.code == 1) {
            haha.details = backData.data;
        }
    });


    var haha = new  Vue({
        el:"#app",
        data:{
            details:{}
        },
        methods:{

            updateDetails(){
                $.post("/ssm/department/updateDetails",haha.details,function (backData) {
                    if (backData.code==1){
                        haha.$message.success('修改成功');
                        window.location.href="/ssm/departmentcontrol/departmentmain.html";
                    }else {
                        haha.$message.error('修改失败');
                    }
                });
            }

        }
    });

</script>
</body>
</html>